namespace Guia.Elements
{
    using System.Windows.Automation;
    using Locator;

    /// <summary>
    /// This class represents a ContextMenu.
    /// A ContextMenu can be invoked from most UiElement (through a right-click). But since it is placed a child-element of Window, it has to be looked up on the particular Window (the window is accessible from each UiElement).
    /// </summary>
    public class ContextMenu : Menu
    {
        /// <summary>
        /// Initializes a new instance of the ContextMenu class. 
        /// </summary>
        /// <param name="automationElement">The AutomationElement representating the ContextMenu.</param>
        public ContextMenu(AutomationElement automationElement)
            : base(automationElement)
        {
        }

        /// <summary>
        /// Gets the default-condition to find a control by its type.
        /// </summary>
        public static new SearchCondition ControlTypeCondition
        {
            get { return SearchCondition.ByControlType(ControlType.Menu).And(SearchCondition.ByClassName("ContextMenu")); }
        }
    }
}